package com.scheduling.order.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 订单项实体
 *
 * @author 开发团队
 * @since 2025-05-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_item")
public class OrderItem implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单项ID
     */
    @TableId(value = "order_item_id", type = IdType.ASSIGN_ID)
    private String orderItemId;

    /**
     * 订单ID
     */
    @TableField("order_id")
    private String orderId;

    /**
     * 产品ID
     */
    @TableField("product_id")
    private String productId;

    /**
     * 数量
     */
    @TableField("quantity")
    private Integer quantity;

    /**
     * 优先级(1-高,2-中,3-低)
     */
    @TableField("priority")
    private Integer priority;

    /**
     * 已生产数量
     */
    @TableField("produced_quantity")
    private Integer producedQuantity;

    /**
     * 状态(待生产/生产中/已完成)
     */
    @TableField("status")
    private String status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 优先级枚举
     */
    public static class Priority {
        public static final Integer HIGH = 1;
        public static final Integer MEDIUM = 2;
        public static final Integer LOW = 3;
    }

    /**
     * 订单项状态枚举
     */
    public static class ItemStatus {
        public static final String PENDING = "待生产";
        public static final String IN_PRODUCTION = "生产中";
        public static final String COMPLETED = "已完成";
    }
} 